package com.anpy.common.service.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "响应的VO对象",description = "封装接口返回给前端的数据")
public class ResultVO {

    @ApiModelProperty(value = "状态码",dataType = "int")
    private int code;
    @ApiModelProperty(value = "响应提示信息",dataType = "string")
    private String msg;
    @ApiModelProperty(value = "返回数据",dataType = "object")
    private Object data;

    public static ResultVO SUCCESS(String msg,Object object){
        return new ResultVO(0,msg,object);
    }

    public static ResultVO ERROR(String msg,Object object){
        return new ResultVO(1,msg,object);
    }
}
